package com.zr.model;
// Generated 2016-10-26 14:56:45 by Hibernate Tools 4.3.1.Final

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * LMuser generated by hbm2java
 * 用户模型
 */
@Entity
@Table(name = "l_muser", catalog = "logistical_managementcrm")
public class LMuser implements java.io.Serializable {

	private Integer uid;
	private LMrole LMrole;
	private String uname;
	private String upsw;
	private Integer uisdelete;//用户是否被删除，只有系统管理员能撤销删除
	private Set<LMfirmPerson> LMfirmPersons = new HashSet<LMfirmPerson>(0);
	private Set<LMcustomer> LMcustomers = new HashSet<LMcustomer>(0);
	private Set<LMdistributionPerson> LMdistributionPersons = new HashSet<LMdistributionPerson>(0);

	public LMuser() {
	}

	public LMuser(LMrole LMrole, String uname, String upsw, Integer uisdelete, Set<LMfirmPerson> LMfirmPersons, Set<LMcustomer> LMcustomers,
			Set<LMdistributionPerson> LMdistributionPersons) {
		this.LMrole = LMrole;
		this.uname = uname;
		this.upsw = upsw;
		this.uisdelete = uisdelete;
		this.LMfirmPersons = LMfirmPersons;
		this.LMcustomers = LMcustomers;
		this.LMdistributionPersons = LMdistributionPersons;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "uid", unique = true, nullable = false)
	public Integer getUid() {
		return this.uid;
	}

	public void setUid(Integer uid) {
		this.uid = uid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "rid")
	public LMrole getLMrole() {
		return this.LMrole;
	}

	public void setLMrole(LMrole LMrole) {
		this.LMrole = LMrole;
	}

	@Column(name = "uname")
	public String getUname() {
		return this.uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	@Column(name = "upsw")
	public String getUpsw() {
		return this.upsw;
	}

	public void setUpsw(String upsw) {
		this.upsw = upsw;
	}

	@Column(name = "uisdelete")
	public Integer getUisdelete() {
		return this.uisdelete;
	}

	public void setUisdelete(Integer uisdelete) {
		this.uisdelete = uisdelete;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "LMuser")
	public Set<LMfirmPerson> getLMfirmPersons() {
		return this.LMfirmPersons;
	}

	public void setLMfirmPersons(Set<LMfirmPerson> LMfirmPersons) {
		this.LMfirmPersons = LMfirmPersons;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "LMuser")
	public Set<LMcustomer> getLMcustomers() {
		return this.LMcustomers;
	}

	public void setLMcustomers(Set<LMcustomer> LMcustomers) {
		this.LMcustomers = LMcustomers;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "LMuser")
	public Set<LMdistributionPerson> getLMdistributionPersons() {
		return this.LMdistributionPersons;
	}

	public void setLMdistributionPersons(Set<LMdistributionPerson> LMdistributionPersons) {
		this.LMdistributionPersons = LMdistributionPersons;
	}

}
